﻿using System.Net.Http;
using CkSoftware.GroupMe.Sdk.Bot.Dao;
using CkSoftware.GroupMe.Sdk.Core;
using CkSoftware.GroupMe.Sdk.Core.Dao;

namespace CkSoftware.GroupMe.Sdk.Bot.Commands
{
	/// <summary>
	/// The destroy bot command (GroupMe documentation: <see href="https://dev.groupme.com/docs/v3#bots_destroy" />).
	/// </summary>
	public class DestroyBotCommand : IWebApiCommand<GroupMeApiResponse<EmptyResponse>>
	{
		private readonly DestroyBotParameters _parameters;

		/// <summary>
		/// Instantiates a new DestroyBot command.
		/// </summary>
		/// <param name="botId">The id of the bot which should be destroyed.</param>
		public DestroyBotCommand(string botId)
		{
			_parameters = new DestroyBotParameters {Id = botId};
		}

		/// <summary>
		/// The name of the command to be executed.
		/// </summary>
		public string CommandName
		{
			get { return "bots/destroy"; }
		}

		/// <summary>
		/// The http method to execute this command.
		/// </summary>
		public HttpMethod HttpMethod
		{
			get { return HttpMethod.Post; }
		}

		/// <summary>
		/// The parameters which should be used on command execution.
		/// </summary>
		public IWebApiCommandParameters Parameters
		{
			get { return _parameters; }
		}

		/// <summary>
		/// Defines if the command is executed once.
		/// </summary>
		public bool CommandExecuted { get; set; }
	}
}